# 设置一个预定义的用户名和密码，用户最多输入 3 次。如果用户名和密码正确，
# 输出 "登录成功"；如果失败 3 次，输出 "登录失败"。


log_count = 0
max_chance = 3

accout1 = {"name": "zjy", "password": "123456"}

while log_count < max_chance:
  print("请输入账号：")
  name = input()
  print("请输入密码：")
  password = input()

  if name == accout1.get("name") and password == accout1.get("password"):
    print("登录成功！")
    break
  elif name != accout1.get("name") and password == accout1.get("password"):
    log_count += 1
    print("账户名错误！")
    continue
  elif name == accout1.get("name") and password != accout1.get("password"):
    log_count += 1
    print("密码错误！")
    continue
  else:
    log_count += 1
    print("账户名和密码均错误！")
    continue

if log_count >= 3:
  print("输入超过三次，本次登录失败")
else:
  print("欢迎进入系统！")
